package com.yswy.domain.entity.tf;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yswy.domain.common.BasePojo;
import com.yswy.domain.entity.user.User;
import com.yswy.domain.vo.gld.addOrUpate.TgDeductionAddOrUpdate;
import com.yswy.domain.vo.gld.addOrUpate.TgDeductionChildAddOrUpdate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@AllArgsConstructor
@Api(tags = "扣量配置")
@TableName(value = "tg_deduction")
public class TgDeduction  extends BasePojo<TgDeduction> {
    @ApiModelProperty("备注")
    private String remarks;
    @ApiModelProperty("编号")
    private String identifier;
    @TableField(exist = false)
    private List<TgDeductionChild> tgDeductionChildrens;


    public TgDeduction(TgDeductionAddOrUpdate res, User user){
        this.remarks =res.getRemarks();
        this.identifier =res.getIdentifier();
        super.setCreateBy(user.getId().longValue());
    }
    public TgDeduction(){

    }
}
